<template>
  <div>
    <div class="dialog-wrap">
      <div class="dialog-cover" v-if="isShow"></div>
      <transition name="drop">
        <div class="dialog-content" v-if="isShow" v-loading="loading"
              element-loading-text="拼命测试中,请稍候"
              element-loading-spinner="el-icon-loading"
              element-loading-background="rgba(0, 0, 0, 0.8)">
              <div class="user-test-content">
                  <div class="user-test-header">
                      <el-steps :active="active" align-center finish-status="success" :class="{isnewerror:statusa}">
                        <el-step :title="title" description="测试中" style="flex-basis:50%"></el-step>
                        <el-step title="测试结果" :description="result"></el-step>
                      </el-steps>
                  </div>
                  <div class="user-test-footer">
                      <el-button type="primary" size="small" @click="closeMyself">确认</el-button>
                  </div>
              </div>
        </div>
      </transition>
    </div>
  </div>
</template>
<script>
export default {
  props: [
    "isShow",
    "title",
    "statusa",
    "active",
    "result",
    "loading"
  ],
  data () {
    return {
    }
  },
  methods: {
    closeMyself () {
      this.$emit('on-close');
    }
  },
  watch:{
    statusa:function(val){
      console.log(this.statusa)
    }
  }
}
</script>
<style >
.drop-enter-active {
  transition: all .5s ease;
}
.drop-leave-active {
  transition: all .3s ease;
}
.drop-enter {
  transform: translateY(-500px);
}
.drop-leave-active {
  transform: translateY(-500px);
}
.dialog-wrap {
  position: fixed;
  width: 100%;
  height: 100%;
}
.dialog-cover {
  background: #000;
  opacity: .3;
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.dialog-content {
  width: 760px;
  height: 300px;
  background: #f5f5f5;
  overflow: hidden;
  position: fixed;
  left: 50%;
  margin-left: -350px;
  top: 50%;
  margin-top: -150px;
  z-index: 101;
  border-radius: 10px;
}
.dialog-close {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 20px;
  height: 20px;
  text-align: center;
  cursor: pointer;
}
.dialog-close:hover {
  color: #4fc08d;
}
.user-test-content{
  width: 80%;
  height: 100%;
  margin: auto;
}
.user-test-header{
  margin-top: 70px;
  overflow: hidden;
  width: 100%;
}
.user-test-footer{
  width: 100%;
  height: 40px;
  text-align: center;
  margin-top: 40px;
}

.user-test-header .isnewerror .el-step__head.is-success{
  color: #f56c6c;
  border-color:#f56c6c;
}
.user-test-header .isnewerror .el-step__title.is-success{
  color: #f56c6c;
}
.user-test-header .isnewerror .el-step__description.is-success{
  color: #f56c6c;
}
.user-test-header .el-steps .el-step{
  width:50%;
}
@media all and (min-width:0\9) {
    .user-test-header .el-steps .el-step .el-step__icon{
      left:46%\9;
    }
}
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { /* 3. */
   .user-test-header .el-steps .el-step .el-step__icon{
      left:0%;
    }
}
</style>